package org.example.mybatis.Mapper;

import org.apache.ibatis.jdbc.SQL;

import java.util.Map;

public class UserSqlProvider {
    public String findActiveUsersByName(Map<String, Object> params) {
        String name = (String) params.get("name");
        SQL sql = new SQL()
                .SELECT("*")
                .FROM("user");
        if(name != null) {
            sql.WHERE("name like '%" + name + "%'");
        }
        return sql.toString();
    }
}
